package com.cr.front.application.controller;

import com.cr.common.response.JsonResult;
import com.cr.front.application.pojo.dto.ApplicationSaveParam;
import com.cr.front.application.service.ApplicationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Api(tags = "企业租车申请")
@RequestMapping("/application")
public class ApplicationController {

    @Autowired
    private ApplicationService applicationService;


    @PostMapping("save")
    @ApiOperation(value = "保存租车申请")
    public JsonResult saveApplication(@Validated @RequestBody ApplicationSaveParam applicationSaveParam) {
        applicationService.save(applicationSaveParam);
        return JsonResult.success();
    }
}
